<?php

class ActionCreateTest extends Action {
	public function IsPermitted(){ return true; }

	public function Render(){


		$x = Test::Create();
		$ui = $x->GetUIObject('new');

		if ($this->IsPostback()){
			$ui->Read(Http::$POST);
			$x->Save();
			Oxygen::Redirect(new ActionHome());
		}


		echo $this->GetForm();
		echo '<label>'.$ui->some_string->GetLabel().'</label>';
		echo '<br/>'.TextboxControl::Make($ui->some_string);

		echo '<br/><br/>';
		echo '<label>'.$ui->some_integer->GetLabel().'</label>';
		echo '<br/>'.TextboxControl::Make($ui->some_integer);

		echo '<br/><br/>';
		echo ButtonControl::Make()->WithValue(Lemma::Retrieve('Save'))->WithIsSubmit(true);
		echo $this->EndForm();



	}
}
?>
